package gewu.suleju.sevice.imp;

import gewu.suleju.dao.iml.IUserDao;
import gewu.suleju.dao.iml.IUserDetailDao;
import gewu.suleju.model.pojo.UserDetail;
import gewu.suleju.sevice.IUserDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Date;


@Service
public class IUserDetailServiceImp implements IUserDetailService {
    @Autowired
    private IUserDetailDao iUserDetailDao;
    @Autowired
    private IUserDao iUserDao;
    @Override
    public UserDetail findUserDetailByUserId(Integer userId) {
        return iUserDetailDao.findUserDetailByUserId(userId);
    }

    //by tjj
    @Override
    public void updateUserDeAll(String username, String password, String phone,String email ,Integer id) {
        iUserDao.updateUserDeAll(username,password,phone,email,id);
    }
    @Override
    public void updateUserDetail(String sex, String birthday, String hometown, String profession, String tag, String person_describe, String company, Integer id)  {
//        SimpleDateFormat format = new SimpleDateFormat("yyyy-MM-dd");
//        Date date=format.parse(birthday);
        iUserDetailDao.updateUserDetail(sex,birthday,hometown,profession,tag,person_describe,company,id);
    }
}
